<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <title>Title</title>
  </head>
  <body>
  </body>
  
  <script>
    /* === 与 !== 与 == 与 != */
    console.log(10 === '10');//false
    console.log(10 == '10');//true
    console.log(10 !== '10');//true
    console.log(10 != '10');//false
    console.log(true == 1)//true
    console.log(true === 1)//false
    console.log(null == undefined)//true
    console.log(null === undefined)//false
    
    /* ** */
    console.log(2 ** 5);//32
    
    /* ... */
    const arr1 = [1, 2];
    console.log(...arr1); // 1 2
    console.log([...arr1, 3, 4]) // [1, 2, 3, 4]
    
    const arr2 = [3, 4, 5];
    const arr3 = [...arr1, ...arr2];
    console.log(arr3); // [1, 2, 3, 4, 5]
    
    // 只能在数组最后一位
    const [one, ...two] = [1, 2, 3, 4, 5]
    console.log(one + '  ' + two); // 1  2,3,4,5
    
    // 转换string为数组
    console.log([...'hello']); // ['h', 'e', 'l', 'l', 'o']
    
    // 展开后作为参数传递
    function func1(x, y, z) {
      console.log(x + ',' + y + ',' + z);//0,1,2
    }
    
    func1(...[0, 1, 2]);
    
    // 可变参数
    function func2(...rest) {
      console.log(rest);//[1, 2, 3]
    }
    
    func2(1, 2, 3)
  </script>
</html>